﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using cecbData;
namespace CECB.Team
{
    /// <summary>
    /// Interaction logic for Team_Search_Window.xaml
    /// </summary>
    public partial class Team_Search_Window : Window
    {
        public Team_Search_Window()
        {
            InitializeComponent();
            cecbClasses.Data_Adapters.Slider slid = new cecbClasses.Data_Adapters.Slider();
           
            TeamAutocompleteTextBox.ItemsSource = slid.getTeamDetails();
        }

        private void TeamReferenceTextBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            cecbClasses.Data_Adapters.Slider slid = new cecbClasses.Data_Adapters.Slider();


            

           //wrapPanelTeam.DataContext = slid.getTeamDetailsByRef(TeamAutocompleteTextBox.Text);
           
            try
            {
                listBoxTeamMembers.ItemsSource = null;
                 listBoxTeamMembers.ItemsSource = slid.getTeamMembersNamesByRef(((Teams)TeamAutocompleteTextBox.SelectedItem).team_reference);
            }
            catch (NullReferenceException)
            {
                 
            }
          //  listBoxTeamPro.ItemsSource = null;
          //  listBoxTeamPro.ItemsSource = slid.getTeamProjectsByTeam(TeamAutocompleteTextBox.Text);
        }

        private void Image_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            this.Close();
        }
    }
}
